<?php
	require_once("conexion/conexion.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<link href="Estilos/global.css" rel="stylesheet" type="text/css" />
<link href="Estilos/local.css" rel="stylesheet" type="text/css" />
<link href="Estilos/CssTabla3.css" rel="stylesheet" type="text/css" />

<script src="include_js/jquery.js" type="text/javascript"></script>
<script>
function EditarStock(valor)
{
	rut = document.getElementById("tbBodega").rows[valor].cells[0].innerText;
	$.ajax({
				type: 'POST',
				url: 'Editar/Carga_Editar_Empleado.php',
				data: {rut:rut},
				success: function(data) {
					$('#tabla').html(data);
				}
			})
}
</script>
</head>

<body>
<form name="analisis" id="analisis" method="post">
<?php
		$con = new Conexion();
		$con2 = $con->conexionBD("fpproduccion");
		$sql="select EmpRut,EmpNombre,EmpApPaterno,EmpApMaterno,EmpDir,EmpFono,EmpSueldo from empleado where 1 order by EmpNombre";
		$res= mysql_query($sql) or die ($con->error_mysql("Error en la consulta".mysql_error()));
		$con->cerrarBD();
?>
<div style="height:5px"></div>
<div class='option2'><label style="font:Verdana, Arial, Helvetica, sans-serif; color:#0066CC; font-weight:bold;">Empleados Ingresados.</label><div style="display:inline; margin-left:545px;"><img src="imagen/cerrar.png" width="16" height="16" onclick="CerrarDatos();" style="cursor: pointer; border: 1px solid #990000;" alt="Cerrar" /></div></div>
  <div class="cabecera">
   <table class="fija" border="0" cellpadding="0" cellspacing="0" id="tbBodega">
      <thead class="fija">
      	<tr class="fija">
      	    <th width="13%" class="fija">rut</th>
			<th width="33%" class="fija">nombre</th>
			<th width="30%" class="fija">direccion</th>
			<th width="11%" class="fija">fono</th>
			<th width="11%" class="fija">sueldo</th>
			<th width="2%" class="fija">&nbsp;</th>
      	</tr>
      </thead>
      <tbody class="fija">
         <tr class="fija"><td colspan="6" class="fija">&nbsp;</td></tr>
		<?php
	$aux = 2;
	while($reg = mysql_fetch_array($res))
	{
		if(($aux % 2)==0)
		{
			echo "<tr class='filaImpar' id='".$aux."'>";
			echo "<td width=\"13%\" style='text-align:lefth;padding-left:5px;'>".$reg['EmpRut']."</td>";
			echo "<td width=\"33%\" style='text-align:lefth;padding-left:5px;'>".$reg['EmpNombre']." ".$reg['EmpApPaterno']." ".$reg['EmpApMaterno']."</td>";
			echo "<td width=\"30%\" style='text-align:lefth;padding-left:5px;'>".$reg['EmpDir']."</td>";
			echo "<td width=\"11%\" style='text-align:lefth;padding-left:5px;'>".$reg['EmpFono']."</td>";
			echo "<td width=\"11%\" style='text-align:lefth;padding-left:5px;'>".number_format ($reg['EmpSueldo'],0,',','.')."</td>";
			echo "<td style='text-align:center'><img src='imagen/edit_icon.gif' width='16' height='16' alt='Editar' style='cursor: pointer;' onclick='EditarStock($aux);'/></td>";
			echo "</tr>";
		}
		else
		{
			echo "<tr class='filaPar' id='".$aux."'>";
			echo "<td width=\"13%\" style='text-align:lefth;padding-left:5px;'>".$reg['EmpRut']."</td>";
			echo "<td width=\"33%\" style='text-align:lefth;padding-left:5px;'>".$reg['EmpNombre']." ".$reg['EmpApPaterno']." ".$reg['EmpApMaterno']."</td>";
			echo "<td width=\"30%\" style='text-align:lefth;padding-left:5px;'>".$reg['EmpDir']."</td>";
			echo "<td width=\"11%\" style='text-align:lefth;padding-left:5px;'>".$reg['EmpFono']."</td>";
			echo "<td width=\"11%\" style='text-align:lefth;padding-left:5px;'>".number_format ($reg['EmpSueldo'],0,',','.')."</td>";
			echo "<td style='text-align:center'><img src='imagen/edit_icon.gif' width='16' height='16' alt='Editar' style='cursor: pointer;' onclick='EditarStock($aux);'/></td>";
			echo "</tr>";
		}
		$aux++;
	}
	?>
      </tbody>
   </table>       
</div>
</form>
</body>
</html>
